import TabsView from '@/layouts/tabs/TabsView';
import BlankView from '@/layouts/BlankView';
//import PageView from '@/layouts/PageView'

// 路由配置
const options = {
  routes: [
    {
      path: '/login',
      name: '登录页',
      component: resolve => require(['@/pages/login'], resolve)//() => import('@/pages/login')
    },
    {
      path: '*',
      name: '404',
      component: resolve => require(['@/pages/exception/404'], resolve) // => import('@/pages/exception/404'),
    },
    {
      path: '/403',
      name: '403',
      component: resolve => require(['@/pages/exception/403'], resolve) //() => import('@/pages/exception/403'),
    },
    {
      path: '/',
      name: '首页',
      component: TabsView,
      redirect: '/login',
      children: [
        {
          path: 'home',
          name: '主页',
          meta: {
            icon: 'project'
          },
          component: resolve => require(['@/pages/home'], resolve)//() => import('@/pages/home')
        },
        {
          path: 'tmodel',
          name: '物模型管理',
          meta: {
            icon: 'form',
            page: {
              cacheAble: false
            }
          },
          component: BlankView,
          children: [
            {
              path: 'mcfg',
              name: '物模型配置',
              meta: {
                icon: 'file-word'
              },
              component: resolve => require(['@/pages/mcfg'], resolve)//() => import('@/pages/mcfg')
            },
            {
              path: 'procfg',
              name: '协议接入配置',
              meta: {
                icon: 'container'
              },
              component: resolve => require(['@/pages/protocolCfg'], resolve)//() => import('@/pages/protocolCfg')
            },
          ]
        },
        {
          path: 'things',
          name: '设备管理',
          meta: {
            icon: 'deployment-unit',
            page: {
              cacheAble: false
            }
          },
          component: BlankView,
          children: [
            /*{
              path: 'dlist',
              name: '设备列表',
              meta: {
                icon: 'pic-right'
              },
              component: () => import('@/pages/dcfg/thing')
            },*/
            {
              path: 'scfg',
              name: '被监控对象配置',
              meta: {
                icon: 'pic-right'
              },
              component: resolve => require(['@/pages/dcfg'], resolve)//() => import('@/pages/dcfg')
            },
            {
              path: 'alarmcfg',
              name: '告警过滤配置',
              meta: {
                icon: 'bell'
              },
              component: resolve => require(['@/pages/alarm/AlarmShield'], resolve)//() => import('@/pages/dcfg')
            },
            {
              path: 'alarmshield',
              name: '告警门限配置',
              meta: {
                icon: 'bell'
              },
              component: resolve => require(['@/pages/alarm/AlarmLimit'], resolve)//() => import('@/pages/dcfg')
            },
            /* {
               path: 'mvideo',
               name: '录像配置',
               meta: {
                 icon: 'dashboard'
               },
               component: () => import('@/pages/storecfg/outerStore')
             },*/
            {
              path: 'area',
              name: '行政区域导入',
              meta: {
                icon: 'heat-map'
              },
              component: resolve => require(['@/pages/area/area.vue'], resolve)//() => import('@/pages/area/area.vue')
            },

          ]
        },
        {

          path: 'data',
          name: '调试',
          meta: {
            icon: 'check-circle-o'
          },
          component: BlankView,

          children: [
            {
              path: 'activeAlarms',
              name: '实时告警',
              meta: {
                icon: 'file-ppt'
              },
              component: resolve => require(['@/pages/alarm/ActiveAlarm.vue'], resolve)//() => import('@/pages/alarm/ActiveAlarm.vue')
            },
            {
              path: 'alarms',
              name: '历史告警',
              meta: {
                icon: 'file-ppt'
              },
              component: resolve => require(['@/pages/alarm/AlarmView'], resolve)//() => import('@/pages/alarm/AlarmView')
            },
            {
              path: 'allalarms',
              name: '告警视图',
              meta: {
                icon: 'file-ppt'
              },
              component: resolve => require(['@/pages/alarm/AlarmView'], resolve)//() => import('@/pages/alarm/AlarmView')
            },
            {
              path: 'tester',
              name: '数据调试',
              meta: {
                icon: 'file-ppt'
              },
              component: resolve => require(['@/pages/tester'], resolve) //() => import('@/pages/tester')
            },
            {
              path: 'pic',
              name: '抓图调试',
              meta: {
                icon: 'file-ppt'
              },
              component: resolve => require(['@/pages/pic/Pic'], resolve) //() => import('@/pages/tester')
            },
            {
              path:'serial',
              name:'串口调试',
              meta:{
                icon:'file-ppt'
              },
              component: resolve => require(['@/pages/serial/serial'], resolve)
            },
          ]
        },
        {

          path: 'maintain',
          name: '维护',
          meta: {
            icon: 'check-circle-o'
          },
          component: BlankView,

          children: [
            {
              path: '/setParams',
              name: '系统设置',
              meta: {
                icon: 'file-ppt'
              },
              component: resolve => require(['@/pages/system/cfg.vue'], resolve)//() => import('@/pages/alarm/ActiveAlarm.vue')
            },
            {
              path: '/upgrade',
              name: '软件升级',
              meta: {
                icon: 'file-ppt'
              },
              component: resolve => require(['@/pages/upgrade/upgrade.vue'], resolve)//() => import('@/pages/alarm/ActiveAlarm.vue')
            },
           
          ]
        }



      ]
    }
  ]
}

export default options
